1. Field of the Invention
The present invention generally relates to the field of graphics processing and more specifically to generating a clip state via a clip state machine for a batch of vertices.
2. Description of the Related Art
A graphics processing pipeline of a graphics processing unit (GPU) accepts a representation of a three-dimensional (3D) scene as an input and processes that input to produce a 2D display image of the scene as an output. As is well known, the 3D graphics scene is typically represented by a collection of primitives having vertices. Indices associated with the vertices are stored in index arrays, and vertex data associated with those vertices is stored in vertex arrays. The primitives are individually processed by the GPU based on the index arrays and the vertex data when generating the 2D display image of the scene.
A conventional graphics processing pipeline has different stages through which the primitives associated with a graphics scene are processed when generating the 2D display image of the graphics scene. In one stage, vertex shading operations, including vertex lighting and transformation, are performed on vertices of the graphics primitives. In another stage, a geometry shader performs geometry shading operations for calculating parameters that are used to rasterize the graphics primitives. In a later stage, clipping, culling, viewport transform, and attribute perspective correction operations on the graphics primitives. In this stage, different culling and clipping techniques to remove graphics primitives within the 3D graphics scene that are not visible in a view frustum, i.e., a region of visible space defined by a set of clip planes.
One drawback of a conventional graphics processing pipeline, is that operations in stages prior to the clipping and culling stage are performed for each of the graphics primitives regardless of whether those graphics primitives are clipped or culled downstream. In such a scenario, memory bandwidth and processing resources of the GPU are wasted unnecessarily to process graphics primitives and vertices of those graphics primitives that are discarded at a later stage.
Accordingly, what is needed in the art is a mechanism for identifying vertices that are eventually culled or clipped in a later stage of the graphics processing pipeline.